/*******************************************************************************
 * Package: com.song.boot.springstudy.webflux
 * Type:    BackpressureMain
 * Date:    2025/4/7 9:51
 *
 * Copyright (c) 2025 LTD All Rights Reserved.
 *
 * You may not use this file except in compliance with the License.
 *******************************************************************************/
package com.song.boot.springstudy.webflux;

import lombok.SneakyThrows;
import reactor.core.publisher.Flux;

import java.time.Duration;

/**
 * 功能描述：背压管理
 *
 * @author Songxianyang
 * @date 2025/4/7 9:51
 */
public class BackpressureMain {
    @SneakyThrows
    public static void main(String[] args) {

        Flux.range(1, 100)
                .onBackpressureBuffer(10)
                .subscribe(System.out::println);


        Thread.sleep(100000);

    }
}
